package net.lzzy.practices.web.models;

import lombok.Getter;
import lombok.Setter;
import net.lzzy.practices.entities.Chapter;

import java.util.Date;
import java.util.UUID;
/**
 * @author hzl on 2022/5/30.
 * Description:
 */
@Setter
@Getter
public class VmChapter {
    private final UUID id;
    private final String name;
    private final String desc;
    private final boolean open;
    private final Date createTime;
    private final Date updateTime;
    private final int countQuestion;
    private final UUID courseId;
    public VmChapter(Chapter chapter){
        id=chapter.getId();
        name=chapter.getName();
        desc=chapter.getDescription();
        createTime=chapter.getCreateTime();
        updateTime=chapter.getUpdateTime();
        countQuestion=chapter.getQuestions().size();
        courseId=chapter.getCourse().getId();
        open=chapter.isOpen();
    }
}
